home *** CD-ROM | disk | FTP | other *** search
/ NetNews Offline 2 / NetNews Offline Volume 2.iso / news / comp / lang / c-part1 / 5846 < prev    next >
Encoding:
Internet Message Format  |  1996-08-05  |  1003 b 

  1. Path: airdmhor.gen.nz!not-for-mail
  2. From: gumboot@airdmhor.gen.nz (Simon Hosie)
  3. Newsgroups: comp.lang.c
  4. Subject: Re: Easiest way to center a string?
  5. Date: 22 Feb 1996 03:02:56 +1300
  6. Organization: Airdmhor : a couple of BBS's, a bunch of people, and a cat.
  7. Message-ID: <4gf8mg$hrm@airdmhor.gen.nz>
  8. References: <4fobka$1st@parlor.hiwaay.net> <DMqEG5.8z4@eskimo.com> <4frif5$e6p@fohnix.metronet.com> <DMuuzG.1yK@eskimo.com> <4gbmmo$m5v@airdmhor.gen.nz> <4gdgs0$jg6@airdmhor.gen.nz>
  9. NNTP-Posting-Host: airdmhor.gen.nz
  10. X-Newsreader: TIN [version 1.2 PL2]
  11.  
  12. Simon Hosie:
  13. > printf("%*s\n", (strlen(String - LineLen) / 2, String);
  14. Simon Hosie:
  15. >   Sorry, make that:
  16. > printf("%*s\n", (strlen(String + LineLen)) / 2, String);
  17.  
  18.   If this one is wrong I'm not correcting myself again, I promise (I haven't
  19. been getting enough sleep, ok?)..
  20.  
  21. printf("%*s\n", (strlen(String) + LineLen) / 2, String);
  22.  
  23.   Ok, I've stared at it for a while, now, and insulted myself..  I will not
  24. do this again (stupid! stupid! stupid!).
  25.